<template>
  <el-dialog title="添加部门" :visible="showDialog" width="50%" @close="close">
    <el-form :model="form" label-width="100px">
      <el-form-item label="部门名称">
        <el-input v-model="form.name" placeholder="请输入部门名称" />
      </el-form-item>
      <el-form-item label="部门编码">
        <el-input v-model="form.code" placeholder="请输入部门编码" />
      </el-form-item>
      <el-form-item label="部门负责人">
        <el-select v-model="form.manager" placeholder="请输入部门负责人" />
      </el-form-item>
      <el-form-item label="部门介绍">
        <el-input
          v-model="form.introduce"
          type="textarea"
          placeholder="请输入部门介绍"
          :rows="3"
        />
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-row type="flex" justify="center">
        <el-button @click="close">取 消</el-button>
        <el-button type="primary" @click="add">确 定</el-button>
      </el-row>
    </span>
  </el-dialog>
</template>

<script>
export default {
  name: 'AddDept',
  props: {
    showDialog: {
      type: Boolean,
      required: true
    }
  },
  data() {
    return {
      form: {
        code: '',
        introduce: '',
        manager: '',
        name: '',
        pid: ''
      }
    }
  },
  methods: {
    close() {
      this.$emit('close')
    },
    add() {
      console.log('add')
    }
  }
}
</script>

<style></style>
